public class NonMotorVh{

    private String color;
    private String brand;
    public NonMotorVh(String color,String brand){
        this.color = color;
        this.brand = brand;
    }

    public String getColor(){
        return color;
    }
    public String getBrand(){
        return brand;
    }
    public void intro(){
        System.out.println("颜色是"+color+"，品牌是"+brand);
    }
};

class Bike extends NonMotorVh {
    private int seat;
    public Bike(String color,String brand,int seat){
        super(color,brand);
        this.seat = seat;
    }
    public void intro(){
        System.out.println("颜色是"+getColor()+"，品牌是"+getBrand()+",座位是"+seat+"个。");
    }
};

class ElcVh extends NonMotorVh  {
    private String battery;
    public ElcVh(String color,String brand,String battery){
        super(color,brand);
        this.battery = battery;
    }
    public void intro(){
        System.out.println("颜色是"+getColor()+"，品牌是"+getBrand()+",电量是"+battery+"。");
    }

};

class Tricycle extends NonMotorVh  {
    private int wheelCount;
    public Tricycle(String color,String brand,int wheelCount){
       super(color,brand);
       this.wheelCount = wheelCount;
    }
    public void intro(){
        System.out.println("颜色是"+getColor()+"，品牌是"+getBrand()+",轮子有"+wheelCount+"。");
    }

};
class Test {
    public static void main(String[] args) {
        NonMotorVh nvh = new NonMotorVh("白色", "无");
        nvh.intro();

        Bike bike = new Bike("红色", "捷安特", 2);
        bike.intro();

        ElcVh elcVh = new ElcVh("蓝色", "爱玛", "98%");
        elcVh.intro();

        Tricycle tricycle = new Tricycle("绿色", "金彭", 3);
        tricycle.intro();

    }
}

